package com.eco.fanliapp.admin.controller.web;

import com.eco.fanliapp.admin.annotation.SysLogAnnotation;
import com.eco.fanliapp.common.response.ServerResponse;
import com.eco.fanliapp.entity.AppCashScheme;
import com.eco.fanliapp.service.ICashschemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/web/cashScheme")
public class CashschemeController {

    @Autowired
    private ICashschemeService cashschemeService;

    /**
     * 查询提现方案列表
     *
     * @param appCashscheme 提现方案信息
     * @return 提现方案集合
     */
    @GetMapping("/selectAppCashschemeList")
    public ServerResponse<List<AppCashScheme>> selectAppCashschemeList(AppCashScheme appCashscheme){

        return cashschemeService.selectAppCashschemeList(appCashscheme);
    }

    /**
     * 新增提现方案
     *
     * @param appCashscheme 提现方案信息
     * @return 结果
     */
    @SysLogAnnotation(value = "新增提现方案",userType = 2)
    @PostMapping("/addAppCashscheme")
    public ServerResponse<List> addAppCashscheme(@RequestBody AppCashScheme appCashscheme){
        return cashschemeService.insertAppCashscheme(appCashscheme);
    }

    /**
     * 修改提现方案
     *
     * @param appCashscheme 提现方案信息
     * @return 结果
     */
    @SysLogAnnotation(value = "修改提现方案",userType = 2)
    @PostMapping("/updateAppCashscheme")
    public ServerResponse updateAppCashscheme(AppCashScheme appCashscheme){
        return cashschemeService.updateAppCashscheme(appCashscheme);
    }

    /**
     * 删除提现方案
     *
     * @param appCashschemeById 提现方案ID
     * @return 结果
     */
    @SysLogAnnotation(value = "删除提现方案",userType = 2)
    @GetMapping("/removeAppCashschemeById")
    public ServerResponse removeAppCashschemeById(Integer appCashschemeById){
        return cashschemeService.deleteAppCashschemeById(appCashschemeById);
    }
}
